Skip to content

Conversation

@RomainBaville
Copy link
Contributor

@RomainBaville RomainBaville commented Sep 26, 2025

In the context of the code refactoring, this pr aims to:

  • Move the filter in the correct folder and update import/doc
  • Stop using VTKPythonAlgorithmBase as mother class of the filter
  • Implement a child class of vtkExtractBlock to extract geos domain directly
  • Implement a test file for the filter.

Note: A future pr will clean all the test mesh

@RomainBaville RomainBaville added the test-geos-integration Triggers the testing of geosPythonPackages import and integration in GEOS CI label Oct 22, 2025
Copy link
Contributor

@jafranc jafranc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an Enum and the outer-most property
Checks from the setters could be a plus. ➕ if not too heavy

"""Extract ElementRegions block from a GEOS output multiBlockDataset mesh."""
super().__init__()

self.geosElementRegionsName: dict[ int, str ] = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This I think is an enum and eventhough should be class var and not instance var :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is indeed an enum and it is already defined in GeosOutputsConstants. I don't need to rewrite it.

elif elementRegionId == 2:
self.well = multiBlockDataSet

extractedElementRegions: ExtractedElementRegionsMesh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be accessible outside of the class ? If not then decorate it with @property

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs to be accessible outside of the class to get the result of the extraction

"The logger already has an handler, to use yours set the argument 'speHandler' to True during the filter initialization."
)

def applyFilter( self: Self ) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If returned value is not used then maybe drop it, else maybe raise an error with diagnostic

@RomainBaville RomainBaville requested a review from jafranc October 28, 2025 06:50
@RomainBaville RomainBaville changed the title refactor: Move GeosBlockExtractor from geos-posp to geos-mesh refactor: Move GeosBlockExtractor from geos-posp to geos-proccessing Oct 28, 2025
Copy link
Contributor

@jafranc jafranc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great edition !!

Comment on lines 34 to 40
assert extractedVolume.GetNumberOfBlocks() == 2

if extractFault:
assert extractedFault.GetNumberOfBlocks() == 2

if extractWell:
assert extractedWell.GetNumberOfBlocks() == 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we check for more than the number of block?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I need to check if the block extracted are the good one with testing the name of the block. As I use vtkExtractBlock, I asume that the extracted block is correct with all the data ... that why I don't test theblock further.

@paloma-martinez paloma-martinez merged commit 6fe3c7b into main Oct 31, 2025
56 checks passed
@paloma-martinez paloma-martinez deleted the RomainBaville/refactor/MoveGeosBlockExtractor branch October 31, 2025 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flag: ready to merge test-geos-integration Triggers the testing of geosPythonPackages import and integration in GEOS CI type: refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants